Optimal. Leaf size=215 \[ \frac {2 (n+2) \sin (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n}{2};\frac {n+2}{2};\cos ^2(e+f x)\right )}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {(2 n+3) \sin (e+f x) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n+1}{2};\frac {n+3}{2};\cos ^2(e+f x)\right )}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {2 (n+2) \tan (e+f x) (d \cos (e+f x))^n}{3 a^2 f (\sec (e+f x)+1)}-\frac {\tan (e+f x) (d \cos (e+f x))^n}{3 f (a \sec (e+f x)+a)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.41, antiderivative size = 215, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {4264, 3817, 4020, 3787, 3772, 2643} \[ \frac {2 (n+2) \sin (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n}{2};\frac {n+2}{2};\cos ^2(e+f x)\right )}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {(2 n+3) \sin (e+f x) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n+1}{2};\frac {n+3}{2};\cos ^2(e+f x)\right )}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {2 (n+2) \tan (e+f x) (d \cos (e+f x))^n}{3 a^2 f (\sec (e+f x)+1)}-\frac {\tan (e+f x) (d \cos (e+f x))^n}{3 f (a \sec (e+f x)+a)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2643
Rule 3772
Rule 3787
Rule 3817
Rule 4020
Rule 4264
Rubi steps
\begin {align*} \int \frac {(d \cos (e+f x))^n}{(a+a \sec (e+f x))^2} \, dx &=\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int \frac {(d \sec (e+f x))^{-n}}{(a+a \sec (e+f x))^2} \, dx\\ &=-\frac {(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac {\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int \frac {(d \sec (e+f x))^{-n} (a (-3-n)-a (-1-n) \sec (e+f x))}{a+a \sec (e+f x)} \, dx}{3 a^2}\\ &=-\frac {2 (2+n) (d \cos (e+f x))^n \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac {\left ((d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} \left (-a^2 (1+n) (3+2 n)+2 a^2 n (2+n) \sec (e+f x)\right ) \, dx}{3 a^4}\\ &=-\frac {2 (2+n) (d \cos (e+f x))^n \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac {\left (2 n (2+n) (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{1-n} \, dx}{3 a^2 d}+\frac {\left ((1+n) (3+2 n) (d \cos (e+f x))^n (d \sec (e+f x))^n\right ) \int (d \sec (e+f x))^{-n} \, dx}{3 a^2}\\ &=-\frac {2 (2+n) (d \cos (e+f x))^n \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac {\left (2 n (2+n) \left (\frac {\cos (e+f x)}{d}\right )^{-n} (d \cos (e+f x))^n\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^{-1+n} \, dx}{3 a^2 d}+\frac {\left ((1+n) (3+2 n) \left (\frac {\cos (e+f x)}{d}\right )^{-n} (d \cos (e+f x))^n\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^n \, dx}{3 a^2}\\ &=\frac {2 (2+n) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {n}{2};\frac {2+n}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {(3+2 n) \cos (e+f x) (d \cos (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {1+n}{2};\frac {3+n}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {2 (2+n) (d \cos (e+f x))^n \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {(d \cos (e+f x))^n \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [F] time = 9.05, size = 0, normalized size = 0.00 \[ \int \frac {(d \cos (e+f x))^n}{(a+a \sec (e+f x))^2} \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.48, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {\left (d \cos \left (f x + e\right )\right )^{n}}{a^{2} \sec \left (f x + e\right )^{2} + 2 \, a^{2} \sec \left (f x + e\right ) + a^{2}}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (d \cos \left (f x + e\right )\right )^{n}}{{\left (a \sec \left (f x + e\right ) + a\right )}^{2}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.19, size = 0, normalized size = 0.00 \[ \int \frac {\left (d \cos \left (f x +e \right )\right )^{n}}{\left (a +a \sec \left (f x +e \right )\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (d \cos \left (f x + e\right )\right )^{n}}{{\left (a \sec \left (f x + e\right ) + a\right )}^{2}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {{\left (d\,\cos \left (e+f\,x\right )\right )}^n}{{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^2} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\left (d \cos {\left (e + f x \right )}\right )^{n}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________